package com.bootdo.app.common.constants;

/**
  * @auther: Along
  * @description: 系统JWT相关常量类
  */
public class JWTConstants {
    public static final String JWT_KEY_USER_ID = "userId";// IJWTInfo.userId
    public static final String JWT_KEY_OPEN_ID = "openId";// IJWTInfo.name
    public static final String JWT_KEY_SID = "sid";// IJWTInfo.name


    public static final String JWT_NAME_USER = "USER";
    public static final String JWT_NAME_ADMIN = "ADMIN";


    public static final String CONTEXT_KEY_USER_ID = "currentUserId";
    public static final String CONTEXT_KEY_USER_TOKEN = "currentUserToken";
    public static final String CONTEXT_KEY_USER_OPEN_ID = "currentUserOpenId";
    public static final String CONTEXT_KEY_USER_SESSION_KEY = "currentUserSessionKey";
    public static final String CONTEXT_KEY_USER_SID = "currentUserSID";

    // redis-JWT-key-rsa(Redis:Hash)
    public static final String JWT_REDIS_KEY = "AUTH:JWT:KEYS";
    public static final String JWT_PUB_HASH_KEY = "PUBLIC";
    public static final String JWT_PRI_HASH_KEY = "PRIVATE";

    // 用户登录TOKEN 版本
    public static final String JWT_AUTH_LOGIN_VERSION_KEY = "AUTH:LOGIN:VERSION:";

    // token-errorCode & msg
    public static final Integer TOKEN_EXPIRED_ERR = 100001;
    public static final String TOKEN_EXPIRED_MSG = "User token is expired!";
    public static final Integer TOKEN_FORMAT_WRONG_ERR = 100002;
    public static final String TOKEN_FORMAT_WRONG_MSG = "Token format is wrong!";
    public static final Integer TOKEN_SIGNATURE_ERR = 100003;
    public static final String TOKEN_SIGNATURE_MSG = "User token signature error!";
    public static final Integer TOKEN_EMPTY_ERR = 100004;
    public static final String TOKEN_EMPTY_MSG = "User token is null or empty!";
    public static final Integer TOKEN_ERR = 100005;
    public static final String TOKEN_ERR_MSG = "非法token";
    public static final Integer REPEAT_LOGIN_ERR = 100006;
    public static final String REPEAT_LOGIN_MSG = "您的账号已在其他地方登录,请重新登录或修改密码!";

}
